package com.atguigu.springcloud.service;

import com.atguigu.springcloud.entities.CommonResult;
import com.atguigu.springcloud.entities.Payment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @Author 周轩霆
 * @Description 业务逻辑接口+@FeignClient配置调用provider服务
 * 新建PaymentFeignService接口并新增注解@FeignClient
 * @Date 21:37 2022/10/17
 * @Param
 * @return
 */
@Component
@FeignClient(value = "CLOUD-PAYMENT-SERVICE")
public interface PaymentFeignService {
    @GetMapping(value = "/payment/get/{id}")
        //接口 没有实现类 但是可以通过open feign直接调用相关服务的方法
    CommonResult<Payment> getPaymentById(@PathVariable("id") Long id);

    //关于超时的方法
    @GetMapping(value = "/payment/feign/timeout")
    public String paymentFeignTimeout();
}
